Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/layers/LayerOpacityStore.kt renovate/fastlane-2.x-lockfile (056eed64) Text, 2.20 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.feature.map.layers

Tff7b72import T7ee787kotlinx.coroutines.CoroutineScope
Tff7b72import T7ee787kotlinx.coroutines.SupervisorJob
Tff7b72import T7ee787kotlinx.coroutines.flow.SharingStarted
Tff7b72import T7ee787kotlinx.coroutines.flow.StateFlow
Tff7b72import T7ee787kotlinx.coroutines.flow.map
Tff7b72import T7ee787kotlinx.coroutines.flow.stateIn
Tff7b72import T7ee787org.koin.core.annotation.Single
Tff7b72import T7ee787org.meshtastic.core.di.CoroutineDispatchers
Tff7b72import T7ee787org.meshtastic.core.repository.MapPrefs

T8b949e/**
* The user's per-layer opacity, for every layer either engine can draw.
*
* Its own store rather than a field on [MapLayersManager]: built-in raster overlays are not imported layers and that
* class knows nothing about them, but both need the same setting and both flavours read it. Keys are documented on
* [MapPrefs.layerOpacity].
*/
Tf0883e@Single
Tff7b72class T56d364LayerOpacityStoreTb4b4b4(Tff7b72private Tff7b72val Te6edf3mapPrefsTb4b4b4: Te6edf3MapPrefsTb4b4b4, Te6edf3dispatchersTb4b4b4: Te6edf3CoroutineDispatchersTb4b4b4) Tb4b4b4{

Tff7b72private Tff7b72val Te6edf3scope Tff7b72= Te6edf3CoroutineScopeTb4b4b4(Te6edf3SupervisorJobTb4b4b4(Tb4b4b4) Tff7b72+ Te6edf3dispatchersTb4b4b4.Te6edf3defaultTb4b4b4)

Tff7b72val Te6edf3opacityTb4b4b4: Te6edf3StateFlowTff7b72<Te6edf3MapTff7b72<Tffa657StringTb4b4b4, Tffa657FloatTff7b72>Tff7b72> Tff7b72=
Te6edf3mapPrefsTb4b4b4.Te6edf3layerOpacity
Tb4b4b4.Te6edf3mapTb4b4b4(Tff7b72::Te6edf3decodeLayerOpacityTb4b4b4)
Tb4b4b4.Te6edf3stateInTb4b4b4(Te6edf3scopeTb4b4b4, Te6edf3SharingStartedTb4b4b4.Te6edf3EagerlyTb4b4b4, Te6edf3decodeLayerOpacityTb4b4b4(Te6edf3mapPrefsTb4b4b4.Te6edf3layerOpacityTb4b4b4.Te6edf3valueTb4b4b4)Tb4b4b4)

T8b949e/** Sets one layer's opacity; [LAYER_OPACITY_OPAQUE] removes its entry rather than storing the default. */
Tff7b72fun Td2a8ffsetOpacityTb4b4b4(Te6edf3keyTb4b4b4: Tffa657StringTb4b4b4, Te6edf3opacityTb4b4b4: Tffa657FloatTb4b4b4) Tb4b4b4{
Te6edf3mapPrefsTb4b4b4.Te6edf3updateLayerOpacity Tb4b4b4{ Te6edf3stored Tff7b72-Tff7b72>
Te6edf3encodeLayerOpacityTb4b4b4(Te6edf3decodeLayerOpacityTb4b4b4(Te6edf3storedTb4b4b4) Tff7b72+ Tb4b4b4(Te6edf3key Te6edf3to Te6edf3opacityTb4b4b4.Te6edf3coerceInTb4b4b4(T79c0ff0fTb4b4b4, Te6edf3LAYER_OPACITY_OPAQUETb4b4b4)Tb4b4b4)Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.2 - Generated in 0.25s